Skip to content

Conversation

@pranavjain97
Copy link
Contributor

@pranavjain97 pranavjain97 commented Jul 25, 2025

Ticket: WP-5355

  • Added request/response types for generate wallet
  • Add request types for all remaining APIs
  • Modularized master api spec to its own router files

@pranavjain97 pranavjain97 force-pushed the WP-5355-dev-docs-wallet-creation-signing branch 3 times, most recently from 510ea69 to 88e7e29 Compare July 25, 2025 21:32
@pranavjain97 pranavjain97 force-pushed the WP-5355-dev-docs-wallet-creation-signing branch from 88e7e29 to 017943a Compare August 8, 2025 20:53
@pranavjain97 pranavjain97 force-pushed the WP-5355-dev-docs-wallet-creation-signing branch 2 times, most recently from 1664afa to d0b154f Compare August 11, 2025 16:54
@pranavjain97 pranavjain97 force-pushed the WP-5355-dev-docs-wallet-creation-signing branch from d0b154f to ef8e38d Compare August 11, 2025 19:31
@pranavjain97 pranavjain97 changed the title chore(mbe): add types and dev docs to generate wallet chore(mbe): add api-ts desc's for wallet creation and signings Aug 11, 2025
@pranavjain97 pranavjain97 marked this pull request as ready for review August 11, 2025 19:37
@pranavjain97 pranavjain97 requested a review from Copilot August 11, 2025 19:39
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the Master BitGo Express API specification by extracting route definitions into separate files and moving types to dedicated route modules. The changes improve code organization and maintain functionality while adding comprehensive API documentation.

  • Extracts individual route definitions from a large monolithic file into dedicated route files
  • Moves type definitions from the main API spec to their respective route modules
  • Adds comprehensive JSDoc documentation for all API endpoints and request/response types

Reviewed Changes

Copilot reviewed 14 out of 16 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/api/master/routers/masterBitGoExpressApiSpec.ts Refactored to import route definitions from separate files, removing hundreds of lines of inline definitions
src/api/master/routers/signAndSendMpcRoute.ts New file containing MPC transaction signing route definition with documentation
src/api/master/routers/sendManyRoute.ts New file containing send many transactions route with comprehensive parameter documentation
src/api/master/routers/recoveryRoute.ts New file containing wallet recovery route with detailed recovery options for different coin types
src/api/master/routers/recoveryConsolidationsRoute.ts New file containing recovery consolidations route for multi-address wallet recovery
src/api/master/routers/generateWalletRoute.ts New file containing wallet generation route with detailed wallet and keychain type definitions
src/api/master/routers/consolidateUnspentsRoute.ts New file containing UTXO consolidation route for unspent transaction outputs
src/api/master/routers/consolidateRoute.ts New file containing address consolidation route for account-based assets
src/api/master/routers/accelerateRoute.ts New file containing transaction acceleration route supporting CPFP and RBF methods
src/api/master/handlers/recoveryWallet.ts Updated import path for moved recovery types
src/api/master/handlers/generateWallet.ts Added request spreading to wallet parameters
src/tests/api/master/generateWallet.test.ts Updated test expectations to match new response type structure
src/tests/api/master/eddsa.test.ts Removed outdated TODO comment
masterBitgoExpress.json Updated OpenAPI specification with enhanced documentation and error response codes

/**
* Common keychain of the wallet during wallet creation
*/
commonKeychain: t.string,
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commonKeychain field is defined as required in the object but optional in the response schema. According to the OpenAPI spec (line 884), this field is required, but the type definition allows it to be undefined. This inconsistency could cause validation issues.

Copilot uses AI. Check for mistakes.
/**
* Required for transactions from MPC wallets.
*/
type: t.union([
Copy link

Copilot AI Aug 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The type field includes values like 'fillNonce', 'acceleration', 'accountSet', 'enabletoken', 'transfertoken', and 'trustline' but the OpenAPI specification shows a different set of values that excludes 'stakingLock' and 'stakingUnlock'. This mismatch between the code and the generated specification could lead to client-side validation errors.

Copilot uses AI. Check for mistakes.
@pranavjain97 pranavjain97 merged commit 166fc70 into master Aug 12, 2025
4 checks passed
@pranavjain97 pranavjain97 deleted the WP-5355-dev-docs-wallet-creation-signing branch August 12, 2025 21:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants